import com.java.demo.controller.UserController;
import com.java.demo.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
//        StudentController bean = context.getBean(StudentController.class);
//        StudentController2 bean1 = context.getBean(StudentController2.class);
//        UserService bean2 = context.getBean("userService",UserService.class);
//        bean.sayHi();
//        bean1.sayHi();
//        bean2.sayHi();
//        UserController userController = context.getBean("userController",UserController.class);
//        com.java.demo.bit.UserController userController2 = context.getBean("userController2", com.java.demo.bit.UserController.class);
//        userController.sayHi();
//        userController2.sayHi();
//        User user1 = context.getBean("user111", User.class);
//        System.out.println(user1.getId());
        UserController userController = context.getBean("userController", UserController.class);
        userController.sayHi();
    }
}
